package com.franklin.ideaplugin.api.utils;

import com.franklin.ideaplugin.api.ui.ToolBarWindowForm;
import com.intellij.openapi.actionSystem.ActionManager;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.DefaultActionGroup;

/**
 * @author Franklin
 * @since 2023/08/09 21:26
 */
public class ExecuteToolBarUtils {

    public static void initToolBar(ToolBarWindowForm toolBarWindowForm){
        DefaultActionGroup debuggingActionsGroup = (DefaultActionGroup) ActionManager.getInstance().getAction("DebuggingActionsGroup");
        for (AnAction childActionsOrStub : debuggingActionsGroup.getChildActionsOrStubs()) {
            toolBarWindowForm.addToolButton(childActionsOrStub);
        }
    }
}
